package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PostingsMapper;
import com.ruoyi.system.domain.Postings;
import com.ruoyi.system.service.IPostingsService;

/**
 * 通知公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-08
 */
@Service
public class PostingsServiceImpl implements IPostingsService 
{
    @Autowired
    private PostingsMapper postingsMapper;

    /**
     * 查询通知公告
     * 
     * @param noticeId 通知公告主键
     * @return 通知公告
     */
    @Override
    public Postings selectPostingsByNoticeId(Long noticeId)
    {
        return postingsMapper.selectPostingsByNoticeId(noticeId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param postings 通知公告
     * @return 通知公告
     */
    @Override
    public List<Postings> selectPostingsList(Postings postings)
    {
        return postingsMapper.selectPostingsList(postings);
    }

    @Override
    public List<Postings> selectList() {
        return postingsMapper.selectList();
    }

    /**
     * 新增通知公告
     * 
     * @param postings 通知公告
     * @return 结果
     */
    @Override
    public int insertPostings(Postings postings)
    {
        postings.setCreateTime(DateUtils.getNowDate());
        return postingsMapper.insertPostings(postings);
    }

    /**
     * 修改通知公告
     * 
     * @param postings 通知公告
     * @return 结果
     */
    @Override
    public int updatePostings(Postings postings)
    {
        postings.setUpdateTime(DateUtils.getNowDate());
        return postingsMapper.updatePostings(postings);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deletePostingsByNoticeIds(Long[] noticeIds)
    {
        return postingsMapper.deletePostingsByNoticeIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeId 通知公告主键
     * @return 结果
     */
    @Override
    public int deletePostingsByNoticeId(Long noticeId)
    {
        return postingsMapper.deletePostingsByNoticeId(noticeId);
    }
}
